import React, { Component } from 'react';
import { BrowserRouter as  Redirect, Route, Switch } from 'react-router-dom';
import { Layout } from 'antd';
import '../css/content.css'
import SideBar from './Sidebar';
import Header from './Header';
import Home from './Home';
import Mall from './Mall';
import User from './User';
import Recommend from './Recommend';
import GoodsDetail from './GoodsDetail';
import AddArtical from './AddArtical';
import AddGoods from './AddGoods';
import ModifyGoods from './ModifyGoods';
import Advice from './Advice';
import ArticalDetail from './ArticalDetail';
import Dating from './Dating';
const { Footer, Sider, Content } = Layout;

export default class Contents extends Component {
    render() {
        return (
            <div>
                <Layout className='layout'>
                    <Sider id='siderbar' width={'20%'}>
                        <SideBar />
                    </Sider>
                    <Layout>
                        <Header />
                        <Content className='content'>
                            <Switch>
                                <Route path='/home' component={Home} />
                                <Route exact path='/recommend' component={Recommend} />
                                <Route path='/recommend/addartical' component={AddArtical} />
                                <Route path='/recommend/detail' component={ArticalDetail} />
                                <Route path='/dating' component={Dating} />
                                <Route exact path='/mall' component={Mall} />
                                <Route path='/user' component={User} />
                                <Route path='/mall/detail' component={GoodsDetail} />
                                <Route path='/mall/addgoods' component={AddGoods} />
                                <Route path='/mall/modifygoods' component={ModifyGoods} />
                                <Route path='/advice' component={Advice} />
                                <Redirect to='/home' />
                            </Switch>
                        </Content>
                        <Footer className='foot' id='foot'>
                            版权所有© 呆鹅小组
                        </Footer>
                    </Layout>
                </Layout>
            </div>
        )
    }
}
